<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">

		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../../JS/common.js"></script>
		<script type="text/javascript" src="../../../JS/finance.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.edatagrid.js"></script>
		<script type="text/javascript" src="../../../JS/SHA-1.js"></script>
		<script type="text/javascript" src="../../../JS/LogisticsShareFunction/SearchShareFunction.js"></script>
	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:550px;">
			<div id="div_search" data-options="region:'north'" style="height:90px;">

			</div>
			<div data-options="region:'center'">
				<div id="p" class="easyui-panel" style="width:100%;height:100%;padding:0px;">
					<div class="easyui-tabs" id="div_tabs" style="width: 100%;">
						<div title="价格维护列表" style="overflow:hidden">
							<div>
								<table id="dg" style="width: 100%;" class="table_style">
								</table>
							</div>
						</div>
					</div>
				</div>
				<div id="toolbar"></div>
				<div id="dlg" class="hiddenDialog">
					<iframe id="ifrmEdit" style="width: 100%;height: 100%;" frameborder="0" scrolling="no"></iframe>
				</div>
			</div>
		</div>
		<script src="../../../JS/LogisticsShareFunction/BasicInfomationSearchFunction.js"></script>
	</body>
	<script type="text/javascript">
		var searchType = SEARCH_CUSTOMER_TYPE;
		var searchContent = buildSearchOptions(searchType, "");
		$("#div_search").append(searchContent);
		var currid = getID();
		var content = "";
		var AddDialog;
		content = AddToolBar(19 + TOOLBAR_REDO);
		$("#toolbar").append(content);

		$('#dg').datagrid({
			url: RemoteLinkAddress + '/logistics/purchasepriceorder/list.do',
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			singleSelect: 'true',
			rownumbers: 'true',
			autoRowHeight: 'true',
			fitColumns: 'false',
			height: 350,
			/*表格中的列名以及各自列名的ID*/
			columns: [
				[{
					field: 'ID',
					title: 'ID',
					width: '0%',
					align: 'center',
				}, {
					field: 'ORDER_NO',
					title: '价格维护表编号',
					width: '27%',
					align: 'center',
				}, {
					field: 'CUSTOMER_TYPE',
					title: '用户组',
					width: '35%',
					align: 'center',
				}, {
					field: 'ISVERIFY',
					title: '审核',
					width: '35%',
					align: 'center',
					formatter: function(value, row, index) {
						return verifyStatus(value);
					}
				}]
			],
			onDblClickRow: function(index, row) {
				var pLocation = "";
				pLocation = "UI/LOGISTICS/BasicInformationInPrice/BasicInformationInPriceAdd.html?id=" + row.ID;
				AddTabIn("采购价格维护表修改", parent.$("#tabs"), pLocation);
			}
		});
		$('#dg').datagrid('hideColumn', 'ID');

		/*添加信息*/
		function newdata() {
			AddTabIn("采购价格维护表新增", parent.$('#tabs'), "UI/LOGISTICS/BasicInformationInPrice/BasicInformationInPriceAdd.html?id=-1");
		}

		function redodata() {
			checkAllData("/logistics/purchasepriceorder/list.do");
		}

		/*编辑信息*/
		function editdata() {
			var pLocation = "";
			var row = $('#dg').datagrid('getSelected');
			if(!row) {
				$.messager.alert('Info', "请选择你需要修改数据"); /*判断是否有行被选中，如果没有，则弹出警告框，提示用户修改数据*/
				return;
			}
			AddTabIn("价格维护表修改", parent.$('#tabs'), "UI/LOGISTICS/BasicInformationInPrice/BasicInformationInPriceAdd.html?id=" + row.ID);
		}

		function doSearch() {
			var searchCondition = "";
			searchCondition = processSearchCondition();
			var _url = RemoteLinkAddress + '/logistics/purchasepriceorder/list.do?' + searchCondition;
			$('#dg').datagrid('load', _url);
		}

		function loaddata() {
			$.messager.confirm('Confirm', '是否导出', function(r) {
				if(r) {
					$.post(RemoteLinkAddress + "/logistics/purchasepriceorder/excel.do", {
							USER_ID: 'admin'
						},
						function(result) {
							if(result.msg == "success") {
								_downloadpath = result.path;
								_pathTarget = "<a class=\'download\' href=\'" + _downloadpath + "\' target='_blank'>点击下载</a>";
								$.messager.alert({ // show error message
									title: '成功',
									msg: _pathTarget
								});
							} else {
								$.messager.alert({ // show error message
									title: 'Error',
									msg: result.msg
								});
							}
						},
						'json');
				}
			});
		}
	</script>

</html>